package com.springboot.springbootweb;

import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
import com.springboot.springbootweb.Bean.Dog;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication(exclude = DruidDataSourceAutoConfigure.class)
@EnableAsync
@EnableScheduling
@EnableCaching
@EnableAspectJAutoProxy
@Import(Dog.class)
public class SpringbootWebApplication {

    public static void main(String[] args) {

        ConfigurableApplicationContext run = SpringApplication.run(SpringbootWebApplication.class, args);

        //System.out.println(run.getBeanFactory());
        /*String[] beans = run.getBeanDefinitionNames();
        for (String bean : beans)
        {
            System.out.println(bean + " of Type :: " + run.getBean(bean).getClass());
        }
        System.out.println(run.getBean("com.springboot.springbootweb.Bean.Dog"));

        //run.close();
        Object factorybeantest = run.getBean("&factorybeantest");
        Object Artisan = run.getBean("artisan");
        System.out.println(Artisan);
        System.out.println(factorybeantest.getClass());*/

    }


}
